package org.wlldTest.lesson3;


import org.dromara.easyai.matrixTools.Matrix;
import org.dromara.easyai.matrixTools.MatrixOperation;

public class Test {
    public static void main(String[] args) throws Exception {
        MatrixOperation matrixOperation = new MatrixOperation();
        Matrix matrix1 = new Matrix(2, 2, "[1,2]#[3,4]");
        Matrix powerMatrix = new Matrix(2, 2, "[2,5]#[7,4]");
        Matrix matrixE = new Matrix(2, 2, "[1,1]#[1,1]");
        for (int i = 0; i < 40; i++) {
            Matrix matrix = matrixOperation.mulMatrix(matrix1, powerMatrix);
            Matrix error1 = matrixOperation.sub(matrixE, matrix);
            System.out.println(error1.getString());
            matrixOperation.mathMul(error1, 0.01f);
            Matrix dr = matrixOperation.matrixMulPd(error1, matrix1, powerMatrix, false);
            powerMatrix = matrixOperation.add(dr, powerMatrix);
        }
    }
}
